﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public static class Constant
{
    public class StructSoundClip
    {
        public string path;
        public AudioClip Load()
        {
            AudioClip ret = Resources.Load<AudioClip>(path);
            return ret;
        }
        public AudioClip PlayOneShot(AudioSource audioSource, float volumeScale = 1f)
        {
            AudioClip clip = Load();
            if (audioSource != null)
            {
                audioSource.PlayOneShot(clip, volumeScale);
            }
            else
            {
                Debug.LogError("Default sound effect is null!");
            }
            return clip;
        }
        public AudioClip PlayOneShot(float volumeScale = 1f)
        {
            return PlayOneShot(CameraLevel.GetCurrentCameraSoundEffect());
        }

    }

    public static class Sounds
    {
        public static StructSoundClip PlayerDeath = new() { path = "Musics/魂斗罗-角色死亡" };
        public static StructSoundClip PlayerBulletC = new() { path = "Musics/魂斗罗-枪声C" };
        public static StructSoundClip PlayerBulletM = new() { path = "Musics/魂斗罗-枪声M" };
        public static StructSoundClip PlayerBulletS = new() { path = "Musics/魂斗罗-枪声S" };
        public static StructSoundClip PlayerBulletF = new() { path = "Musics/魂斗罗-枪声F" };
        public static StructSoundClip PlayerBulletL = new() { path = "Musics/魂斗罗-枪声L" };

        public static StructSoundClip EnemyDeath1 = new() { path = "Musics/魂斗罗-敌人-爆炸" };
        public static StructSoundClip EnemyDeath2 = new() { path = "Musics/魂斗罗-敌人-爆炸2" };
        public static StructSoundClip EnemyOnHit = new() { path = "Musics/魂斗罗-敌人-被打中" };
        public static StructSoundClip GameOver = new() { path = "Musics/魂斗罗-GameOver" };
        public static StructSoundClip MapFlagTick = new() { path = "Musics/魂斗罗-地图滴答" };
        public static StructSoundClip MapAlarm = new() { path = "Musics/魂斗罗-地图警报" };
        public static StructSoundClip MapBrideyeScroll = new() { path = "Musics/魂斗罗-地图鸟瞰地图显示" };
        public static StructSoundClip Pause = new() { path = "Musics/魂斗罗-暂停" };
        public static StructSoundClip TitleMusic = new() { path = "Musics/魂斗罗-标题音乐" };
        public static StructSoundClip Level1_BackroundMusic = new() { path = "Musics/魂斗罗-第一关-背景" };
        public static StructSoundClip Level24_BackroundMusic = new() { path = "Musics/魂斗罗-第二，四关-背景" };
        public static StructSoundClip PlayerFootsteps = new() { path = "Musics/魂斗罗-脚步" };
        public static StructSoundClip BossAlarm = new() { path = "Musics/魂斗罗-Boss-警报" };
        public static StructSoundClip BossDeath = new() { path = "Musics/魂斗罗-Boss-爆炸" };
        public static StructSoundClip Victory = new() { path = "Musics/魂斗罗-过关" };
        public static StructSoundClip ElectricShock = new() { path = "Musics/魂斗罗-电击" };

    }

    public static class Player
    {
        public static GameObject ContraPlayer = Resources.Load<GameObject>("Prefabs/比尔");
    }

    public class StructPrefab
    {
        public string path;
        public GameObject Load()
        {
            GameObject ret = Resources.Load<GameObject>(path);
            return ret;
        }

    }
    public static class Prefabs
    {
        public static StructPrefab EnemyBoom1 = new() { path = "Prefabs/敌_爆炸1" };
        public static StructPrefab EnemyBoom2 = new() { path = "Prefabs/敌_爆炸2" };
        public static StructPrefab EnemyBulletC = new() { path = "Prefabs/敌_子弹_C" };
        public static StructPrefab EnemyBulletM = new() { path = "Prefabs/敌_子弹_M" };
        public static StructPrefab EnemyBulletBOSS1 = new() { path = "Prefabs/敌_子弹_BOSS1" };
        public static StructPrefab Enemy3DCoreSmall = new() { path = "Prefabs/敌-3D-核心-小" };
        public static StructPrefab Enemy3DCoreBig = new() { path = "Prefabs/敌-3D-核心-大" };
        public static StructPrefab Enemy3DTurretSmall = new() { path = "Prefabs/敌-3D-炮台-小" };
        public static StructPrefab Enemy3DRollLauncher = new() { path = "Prefabs/敌-3D-滚筒-出口" };
        public static StructPrefab Enemy3DRoller = new() { path = "Prefabs/敌-3D-滚筒" };
        public static StructPrefab EnemyBoss2Bullet = new() { path = "Prefabs/魂-第二关-Boss-弹" };
        public static StructPrefab GunAward = new() { path = "Prefabs/枪" };
        public static StructPrefab Grenade3D = new() { path = "Prefabs/敌-3D-手雷" };
    }

    public class StructMaterial
    {
        public string path;
        public Material Load()
        {
            Material ret = Resources.Load<Material>(path);
            return ret;
        }

    }
    public static class Materials
    {
        public static StructMaterial FadeIn = new() { path = "Materials/魂_首页_颜色淡出" };
        public static StructMaterial LanceColor = new() { path = "Materials/魂_兰斯的颜色" };
        public static StructMaterial BillColor = new() { path = "Materials/魂_比尔的颜色" };
        public static StructMaterial Enemy3DSoldierRedColor = new() { path = "Materials/魂_3D_红人" };
        public static StructMaterial Enemy3DSoldierNormalColor = new() { path = "Materials/魂_3D_正常" };
    }

    public static class LayersMask{
        public static LayerMask GroundLayer=1<<LayerMask.NameToLayer("跳台");
        public static LayerMask WallLayer=1<<LayerMask.NameToLayer("墙");
        public static LayerMask WaterLayer=1<<LayerMask.NameToLayer("水面");
    }

}


